<?php
namespace test\bianlian;
class User{

    private $roleList = array( 0=> 'system', 1=> 'admin', 2=>'shop' , 3=> 'user' ,4 => 'shoper');
    private $role;      //角色 system [系统 类似超级用户用户] admin [后台管理员] shop [店铺管理员]  user [平台用户]    
    private $userId;
    private $plat;  // 用户当前登陆的平台 1 平台管理后台 2 商户管理后台 3 前端用户展示平台


    public function __construct($plat,$userId,$role = null){
        $this->userId = $userId;
        $this->plat   = $plat;
        $this->role   = $role;
    }

	
    /**
     * 获取用户对象
     */
    public static function getInstance(...$argc){
        static $_instance	=	array();
        $uid = $argc[0].'_'.$argc[1];
		if(!isset($_instance[$uid])){
            $_instance[$uid] = new static(...$argc);
		}
		return $_instance[$uid];
    }


}